<!--
 * @Author: Vi卡农
 * @Date: 2020-04-21 17:45:06
 * @LastEditTime: 2020-05-07 15:53:43
 * @Description: -意向单page-
 * @FilePath: \cshf_admin\src\views\modules\intention\intentionPages.vue
 -->
<template>
  <div class="intentionPages">
     <el-row>
      <el-col :span="18">
        <span class="title_span">意向单管理 - 意向单详情</span>
      </el-col>
      <el-col :span="5" style="text-align:right">
        <el-button
          v-if="$hasPermission('house:houseinfo:update')"
          type="text"
          icon="el-icon-edit"
           @click="UpdateHandle"
        >修改</el-button>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="18">
        <!-- <span class="title_span">意向单 - 意向单详情</span> -->
      </el-col>
      <el-col :span="5" style="text-align:right">
        <!-- <el-button
          v-if="$hasPermission('intention:intentioninfo:update')"
          type="text"
          icon="el-icon-edit"
        >修改</el-button>-->
      </el-col>
    </el-row>
    <el-card class="box-card" shadow="hover">
      <div slot="header" class="clearfix">
        <span
          class="font_wei600"
          style="font-size:18px"
        >意向单编号：{{"YX - "+intentionId.substring(intentionId.length-6)}}</span>
      </div>
      <el-tabs v-model="activeName" class="customTabs">
        <el-tab-pane name="first">
          <div slot="label">
            <img src="~@/assets/img/基本信息.png" alt />
            <div class="text_center">基本信息</div>
          </div>
          <intentionLease :intentionId="intentionId" ref="intentionLease"></intentionLease>
        </el-tab-pane>
        <el-tab-pane name="genjin">
          <div slot="label">
            <img src="~@/assets/img/跟进记录.png" alt />
            <div class="text_center">跟进记录</div>
          </div>
          <housefollow :intentionId="intentionId"></housefollow>
        </el-tab-pane>

        <el-tab-pane name="stateUpdate">
          <div slot="label">
            <img src="~@/assets/img/状态变更.png" alt />
            <div class="text_center">核心内容</div>
          </div>
          <stateUpdate :intentionId="intentionId"></stateUpdate>
        </el-tab-pane>
        <el-tab-pane name="changecontract">
          <div slot="label">
            <img src="~@/assets/img/状态变更.png" alt />
            <div class="text_center">转合同</div>
          </div>
          <changecontract :intentionId="intentionId"></changecontract>
        </el-tab-pane>
        <el-tab-pane name="syslogdetailed">
          <div slot="label">
            <img src="~@/assets/img/任务中心.png" alt />
            <div class="text_center">操作日志</div>
          </div>
          <syslogdetailed :intentionId="intentionId"></syslogdetailed>
        </el-tab-pane>
      </el-tabs>
    </el-card>
     <add-or-update v-if="UpdateVisible" ref="addOrUpdate"></add-or-update>
  </div>
</template>
<script>
import intentionLease from "./page/intentionLease";
import housefollow from "./page/housefollow";
import stateUpdate from "./page/stateUpdate";
import syslogdetailed from "./page/syslogdetailed";
import changecontract from "./page/changecontract";
import AddOrUpdate from "./page/intentioninfo-add-or-update";
export default {
  name: "",
  data() {
    return {
      intentionId: this.$route.query.ID,
      activeName: "first",
       UpdateVisible: false
    };
  },
  components: {
    intentionLease,
    housefollow,
    stateUpdate,
    syslogdetailed,
    changecontract,
    AddOrUpdate
  },
  created() {},
  methods: {
      UpdateHandle() {
      this.UpdateVisible = true;
      this.$nextTick(() => {
        this.$refs.addOrUpdate.dataForm.id = this.$route.query.ID;
        this.$refs.addOrUpdate.init();
      });
    },
    CloseDialogFun() {
      this.UpdateVisible = false;
      this.$refs.contractLease.getIntention();
    }
  },
  watch: {
    $route(to, from) {
      if (to.name == "intentionPages") {
        this.intentionId = this.$route.query.ID;
      }
    }
  }
};
</script>
<style  scoped lang="scss">
.title_span {
  display: inline-block;
  font-size: 16px;
  color: rgb(116, 116, 116);
  line-height: 33px;
}
</style>